package smdc.order.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import smdc.common.utils.DateUtils;
import smdc.order.domain.DiningTable;
import smdc.order.mapper.DiningTableMapper;
import smdc.order.service.IDiningTableService;

/**
 * 桌位Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-27
 */
@Service
public class DiningTableServiceImpl implements IDiningTableService 
{
    @Autowired
    private DiningTableMapper diningTableMapper;

    /**
     * 查询桌位
     * 
     * @param tableId 桌位主键
     * @return 桌位
     */
    @Override
    public DiningTable selectDiningTableByTableId(Long tableId)
    {
        return diningTableMapper.selectDiningTableByTableId(tableId);
    }

    /**
     * 查询桌位列表
     * 
     * @param diningTable 桌位
     * @return 桌位
     */
    @Override
    public List<DiningTable> selectDiningTableList(DiningTable diningTable)
    {
        return diningTableMapper.selectDiningTableList(diningTable);
    }

    /**
     * 新增桌位
     * 
     * @param diningTable 桌位
     * @return 结果
     */
    @Override
    public int insertDiningTable(DiningTable diningTable)
    {
        diningTable.setCreateTime(DateUtils.getNowDate());
        return diningTableMapper.insertDiningTable(diningTable);
    }

    /**
     * 修改桌位
     * 
     * @param diningTable 桌位
     * @return 结果
     */
    @Override
    public int updateDiningTable(DiningTable diningTable)
    {
        diningTable.setUpdateTime(DateUtils.getNowDate());
        return diningTableMapper.updateDiningTable(diningTable);
    }

    /**
     * 批量删除桌位
     * 
     * @param tableIds 需要删除的桌位主键
     * @return 结果
     */
    @Override
    public int deleteDiningTableByTableIds(Long[] tableIds)
    {
        return diningTableMapper.deleteDiningTableByTableIds(tableIds);
    }

    /**
     * 删除桌位信息
     * 
     * @param tableId 桌位主键
     * @return 结果
     */
    @Override
    public int deleteDiningTableByTableId(Long tableId)
    {
        return diningTableMapper.deleteDiningTableByTableId(tableId);
    }
}
